package StructuralPattern.Facade;

public class NewEncryptFacade extends AbstractEncryptFacade {

    private FileReader fileReader;
    private FileWriter fileWriter;
    private NewCipherMachine newCipherMachine;

    public NewEncryptFacade() {
        fileReader = new FileReader();
        fileWriter = new FileWriter();
        newCipherMachine = new NewCipherMachine();
    }

    @Override
    public void fileEncrypt(String fileNameSrc, String fileNameDes) {
        String plainStr = fileReader.read(fileNameSrc);
        String encrypt = newCipherMachine.encrypt(plainStr);
        fileWriter.write(encrypt,fileNameDes);
    }
}
